﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.Xml;
using System.Data;


using Gift.WebApp;
using Gift.DAL;
using Gift.Model;

public partial class cn_UserControl_member_menu : System.Web.UI.UserControl
{
    // Fields

    tbUser oUser = new tbUser();
    BasePage thePage = new BasePage();
    // Methods
    protected StringBuilder MemberInfoBind()
    {
        StringBuilder builder = new StringBuilder();
        try
        {
            builder.AppendLine("<div>");
            DataTable userById = new DataTable();
            if (thePage.LoginUserMember == null || thePage.LoginUserMember.ClientUser == null)
            {
                userById = BaseFactory.theUser.GetUserById(thePage.LoginUserMember.ClientUser.id);
            }
            if (userById.Rows.Count > 0)
            {
                DataRow row = userById.Rows[0];
                builder.AppendLine("<h5>" + row["userName"] + "</h5>");
                builder.AppendLine("<p>您好！欢迎光临!</p>");
                builder.AppendLine("<p>会员级别：" + row["rankName"] + "</p>");
                builder.AppendLine("<p>现金余额：<strong>" + string.Format("{0:C}", row["money"]) + "</strong></p>");
                builder.AppendLine("<p>消费积分：<strong>" + row["payPoints"] + "</strong>&nbsp;&nbsp;<a href=\"/cn/points_for_list.html\">积分兑换</a></p>");
            }
            builder.AppendLine("</div>");
        }
        catch
        {
        }
        return builder;
    }

    protected void Page_Load(object sender, EventArgs e)
    {
    }

 
}